package com.syezon.wifikey.web;

import android.content.Context;
import android.content.Intent;

import com.syezon.wifikey.cengwang.CengwangTipDetailActivity;


/**
 * Created by Administrator on 2016/9/30.
 */

public class WebHelper {
    public static final String ARG_URL = "url";
    public static final String ARG_NEWS_ID = "news_id";
    public static final String ARG_NEWS_INFO = "news_info";
    public static final String ARG_PUSH_NEWS = "push_news";

    /**
     * @param context
     * @param url
     * @param title   展示东方头条新闻详情页
     */
    public static void showDfNewsDetail(Context context, String url, String title) {
        Intent intent = new Intent();
        intent.putExtra(ARG_URL, url);
        intent.setClass(context, WebAdDetailActivity.class);
        context.startActivity(intent);
    }

    public static void showAd(Context context, String url, String title) {
        Intent intent = new Intent();
        intent.putExtra(ARG_URL, url);
        intent.setClass(context, WebAdDetailActivity.class);
        context.startActivity(intent);
    }

    public static void showCengeangTip(Context context , String title , String url , WebLoadCallBack callBack){
        CengwangTipDetailActivity.setWebLoadCallBack(callBack);
        Intent intent = new Intent(context, CengwangTipDetailActivity.class);
        intent.putExtra(ARG_URL, url);
        context.startActivity(intent);
    }

    public static void showAd(Context context , String title , String url , WebLoadCallBack callBack){
        WebAdDetailActivity.setWebLoadCallBack(callBack);
        Intent intent = new Intent(context, WebAdDetailActivity.class);
        intent.putExtra(ARG_URL, url);
        context.startActivity(intent);
    }


    public interface WebLoadCallBack {
        void loadBefore(String url);

        void loadComplete(String url);

        void loadError(String url);
    }

    public static class SimpleWebLoadCallBack implements WebLoadCallBack {
        @Override
        public void loadBefore(String url) {

        }

        @Override
        public void loadComplete(String url) {

        }

        @Override
        public void loadError(String url) {

        }
    }
}
